package utils

import "github.com/kataras/iris/v12"

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type ResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func ResponseServerError(err error) Response {
	return Response{Code: iris.StatusInternalServerError, Message: err.Error()}
}

func ResponseOK() Response {
	return Response{Code: 200, Message: "ok", Data: "ok"}
}

func ResponseData(data interface{}) Response {
	return Response{Code: 200, Message: "ok", Data: data}
}
